blog home page link issue
Hi,
after I make the blog page and do the necessary stuff like installing the app, the blog page is showing the information on the contacts page !!!
Here are a few snippets:
1) mysite/urls.py:
<pre class='prettyprint lang-py'>
from django.conf.urls import url, include
from django.contrib import admin
urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'^', include('personal.urls')),
url(r'^blog/', include('blog.urls'))
]
</pre>
2) settings.py:
<pre class='prettyprint lang-py'>
INSTALLED_APPS = [
'personal',
'blog',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
]
</pre>
3) blog/urls.py:
<pre class='prettyprint lang-py'>
from django.conf.urls import url, include
from django.views.generic import ListView, DetailView
from blog.models import Post
urlpatterns = [url(r'^$', ListView.as_view(queryset = Post.objects.all().order_by("-date")[:25], template_name = "blog/blog.html"))]
</pre>
4) blog.html:
<pre class='prettyprint lang-py'>
<html>
<body><h1>"lolopokokpekepLOL"</h1></body>
</html>
</pre>
PLease help,
thanks,
varun
You must be logged in to post. Please login or register an account.